//
//  StudioWorkCollectionViewCell.m
//  Arts1
//
//  Created by 孤星晨宇 on 15/9/23.
//  Copyright (c) 2015年 Arts1. All rights reserved.
//

#import "StudioWorkCollectionViewCell.h"
#import "AllHeader.h"

@implementation StudioWorkCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        UIView *whiteView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH - 20, 60)];
        whiteView.backgroundColor = [UIColor whiteColor];
        whiteView.layer.cornerRadius = 4;
        whiteView.layer.masksToBounds = YES;
        [UIView viewShadowColor:whiteView];
        
        _lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 4, 60)];
        //  _lineView.layer.cornerRadius = 5;
        _lineView.backgroundColor = kColorforRandomColor;
//        [UIView viewRediusForTopAndBottomForLeft:_lineView withRedius:5];
        [whiteView addSubview:_lineView];
        
        _titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 200, 30)];
        _titlelabel.text = @"中央美术学院2016年考试时间安排====";
        _titlelabel.font = [UIFont systemFontOfSize:13];
        [whiteView addSubview:_titlelabel];
        
        _detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, _titlelabel.bottom, 200, 30)];
        _detailLabel.text = @"中央美术学院2016年考试";
        _detailLabel.font = [UIFont systemFontOfSize:10];
        [whiteView addSubview:_detailLabel];
        
        _applyLabel = [[UILabel alloc] initWithFrame:CGRectMake(whiteView.width - 80 , (whiteView.height - 14)/2.0, 70, 14)];
        _applyLabel.font = [UIFont systemFontOfSize:12];
        _applyLabel.textAlignment = NSTextAlignmentRight;
        _applyLabel.text = @"已报名：";
        [whiteView addSubview:_applyLabel];
        
        [self.contentView addSubview:whiteView];
 
        
    }
    return self;
}

- (void)setWork:(WorkModel *)work{
    _work = work;
    _titlelabel.text = _work.title;
    _detailLabel.text = _work.addTime;
    _applyLabel.text = [NSString stringWithFormat:@"%@件",_work.views];
}






@end
